<?php

class Zend_View_Helper_TenMostRecent extends Zend_View_Helper_Abstract {
	
	protected $records;
	
	public function __construct()
	{
		$mongo = new Mongo();
		 
		$db = $mongo->mugshots;
		
		$this->records =
			$db->shots
			->find(array(), array('arrest_date' => 1,'name' => 1, 'seq' => 1, 'offenses' => 1))
			->limit(10)
			->sort(array("arrest_date" => -1));
	
	}
	
	public function tenMostRecent()
	{
		$this->view->records = $this->records;
		
		$output = $this->view->render('helpers/ten-most-recent/index.phtml');
		
		return $output;
		
	}
	
	
}
